package com.itheima.ThreadPrac3;

public class mythread3 extends Thread{

    int number=1;
    @Override
    public void run() {

        while (true)
        {
            synchronized (Thread.class)
            {
                if(number>100)
                    break;
                else
                {
                    if(number%2==1)
                    {
                        System.out.println(getName()+":"+number);

                    }
                    number++;
                }
            }
        }
    }
}
